﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<%@ Import Namespace="skags.Models" %>

<div class="top_articles">
<h2>Mest lesnu greinar</h2>

    <% foreach (var item in (IEnumerable<ArticleViewModel>)ViewData["TopArticles"]) { %>
      
       <span class="title"><a href="Article/ViewItem/<%: item.ID %>"> <%: item.Title %></a></span> <br />
       <span class="categoryName"> <%= item.CategoryName %> </span>   
       <span class="read_count">( <%: item.ReadCount.ToString() == "" ? 0 : item.ReadCount %> )</span> <br />
       <span class="author"> <%: item.CreatorName %> </span>
       <span class="date">Þann <%= String.Format("{0:g}", item.DateCreated) %></span>
        <br /> <br />       
    <% } %>
<br />
</div>
